QUEST = {}
Quest = {}
	
QUEST.__index = QUEST

AccessorFunc( SPELL, "m_sName", "Name", FORCE_STRING )
AccessorFunc( SPELL, "m_iQuestID", "QuestID", FORCE_NUMBER )
AccessorFunc( SPELL, "m_bDaily", "Daily", FORCE_BOOL )
AccessorFunc( SPELL, "m_bIsTimed", "IsTimed", FORCE_BOOL )
AccessorFunc( SPELL, "m_iTimerLength", "TimerLength", FORCE_NUMBER )

QUEST_INVALID = -1

QUEST.QuestID = 0

OBJECTIVE_KILL = 0 -- FORMAT: {NPC ID/class name, amount}
OBJECTIVE_COLLECT = 1 -- FORMAT: {OBJECT ID, amount}
OBJECTIVE_SPEAK = 2 -- FORMAT: {NPC ID}
OBJECTIVE_ESCORTNPC = 3 -- FORMAT: {NPC ID (NPC to escort), NPC ID(Escorting to this NPC)}
OBJECTIVE_ESCORTLOCATION = 4 -- FORMAT: {NPC ID (NPC to escort), Vector3 (Escort location)}
OBJECTIVE_INTERACT = 5 -- FORMAT: {OBJECT ID}

QUEST.Name = "Anus Painus"
QUEST.Text = {[[I seriously need to take a giant shit, but Dick Coleslaw has
				stolen all of my TP. If you take my TP back for me, I'll make
				sure that you're compensated generously.]], 
			[[Kill Dick Coleslaw and retrieve Anus Painus' Toilet Paper. ]]}
			
QUEST.CompleteText = {[[Whew, thanks! I'm off to go drop a deucer, good luck.]]}
			
QUEST.Objectives = {
	{OBJECTIVE_KILL, {1, 1}}
}

QUEST.Reward = {}

QUEST.Daily = false
QUEST.Weekly = false

print("Acquiring quests...")

local _R = debug.getregistry( )
	_R.Quest = QUEST
local n, m

local curindex = 1

function QUEST:AffectPlayer( pl )
end

function QUEST:Accept(pl)
	SetPlayerOnQuest(pl, self.QuestID)
end

function QUEST:Completed(loot)
	if SERVER then
		GivePlayerLoot(loot)
	end
end

function QUEST:TimeOut()
	if SERVER then
		--SetQuestExpired(self.m_iQuestID)
	end
end


for n, m in ipairs( file.Find( "gamemodes/RPGDM/gamemode/quests/*.lua", "MOD" ) ) do
	
	print( "quests/" .. m)
	AddCSLuaFile( "quests/" .. m )
	include( "quests/" .. m)
		
	
	
	local QUEST = table.Copy(_R.Quest)
	
	table.insert( Quest, QUEST )
		curindex = curindex + 1
end

